#include <stdio.h>

void main()
{
    int n = 0;
    printf("enter string:");

    // 只要从键盘输入的字符不是回车就继续循环
    // getchar - get a byte from a stdin stream
    while (getchar() != '\n')
    {
        n++;
    }
    printf("number is: %d\n", n);
}